package com.oliver.picturebackend.strategy.picture;

import com.oliver.picturebackend.model.enums.PictureFetchSourceEnum;

import java.util.Map;

/**
 * @ClassName PictureUploadBatchFactory
 * @Description TODO
 * @Author snow
 * @Date 2024/12/15 16:11
 **/
public class PictureUploadBatchFactory {

    private static Map<String, PictureUploadBatchStrategy> strategyMap;

    static {
        strategyMap.put(PictureFetchSourceEnum.DEFAULT.getCode(),new BiyinStrategy());
    }

    public void doUploadBatch(String code){
        PictureUploadBatchStrategy uploadBatchStrategy = strategyMap.getOrDefault(code, new BiyinStrategy());
        String url = PictureFetchSourceEnum.getUrlByCode(code);
        uploadBatchStrategy.doUploadStrategy(url);
    }

}
